package com.nb.cloud.doc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.nb.cloud.doc.entity.Atlas;
import com.nb.cloud.doc.mapper.AtlasMapper;
import com.nb.cloud.doc.service.IAtlasService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 知识图谱表 服务实现类
 * </p>
 *
 * @author 作者
 * @since 2024-08-15
 */
@Service
public class AtlasServiceImpl extends ServiceImpl<AtlasMapper, Atlas> implements IAtlasService {

    @Autowired
    AtlasMapper atlasMapper;

    @Override
    public Atlas getByTitle(String title) {
        LambdaQueryWrapper<Atlas> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Atlas::getName,title).eq(Atlas::getDeleteFlag,0);
        return getOne(wrapper);
    }

    @Override
    public Integer findLastSortNo(String secondId) {
        return atlasMapper.findLastSortNo(secondId);
    }
}
